<template>
  <div style="display: inline">
    <el-button @click="procure" type="1688" :disabled="this.orderIds.length === 0" class="mgr10 mgb10">从1688采购</el-button>

  </div>
</template>

<script>
import {deliveryOrder, getExpressList, order1688} from "@/api/order";
import {deepCopy} from "@/utils";
import {EventBus} from "@/utils/eventBus";
import {getAppName} from "@/utils/settings";

export default {
  name: "Ali1688ProcureButton",
  props:{
    orderId:{
      type: String,
    },
    orderIds:{
      type: Array,
      require: true,
    },
    disable:{
      default: false,
    },
  },
  computed:{

  },
  created() {
    // console.log(this.expressGroupOptions);
    // this.getOptions()
    // this.currentForm.orderIds = this.orderIds;
  },
  data(){
    return {
      dialogForm: false,
      dialogAuth: false, // 授权dialog
      loading: false,
    };
  },
  methods:{
    getAppName,
    procure(){
      // 判断是否授权了1688
      if(this.$store.getters.auth1688){
        EventBus.$emit('show1688AuthDialog');
        return;
      }else{
        // 完成了授权 跳转到采购页
        this.$router.push({
          name: 'previewOrder',
          query: {
            orderIds: this.orderIds
          }
        })


      }
    },
    jumpAuth(){
      window.open(this.$store.getters.auth1688Url,'_blank')
    },

  }
}
</script>

<style scoped lang="scss">
.auth-dialog{
  .content{
    margin: 0 auto;
    width: 600px;
    padding: 30px 0;
    .img{
      text-align: center;
    }
    p{
      margin: 0;
      padding: 0;
      line-height: 20px;
      font-weight: 650;
      color: #1E3369;
      font-size: 13px;
      text-align: center;
    }
  }
  .auth-img-jump{
    position: absolute;
    cursor: pointer;
    //background: #cccccc;
    width: 150px;
    height: 150px;
    top: 180px;
    left: 320px;
  }
}
.order1688-tips{
  position: absolute;
  top: 50px;
  left: 21px;
  color: #aaaaaa;
}

</style>
